<!-- 静态树形菜单页面 -->
<template>
  <div class="common_screen">

    <!-- 布局容器 -->
    <el-container :style="containerStyle">

      <!-- 左边导航栏 -->
      <el-aside width="200px" style="background-color:#545c64;">

        <el-menu
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          router
          :default-active="'index'"> <!-- router属性：表示使用router自由切换 -->

            <el-menu-item index="/index">
              <i class="el-icon-location"></i>
              <span slot="title">系统首页</span>
            </el-menu-item>
            <el-submenu index="system">
              <template slot="title">
                <i class="el-icon-setting"></i>
                <span>系统管理</span>
              </template>
              <el-menu-item index="/system/userList">
                <span slot="title">用户管理</span>
              </el-menu-item>
              <el-menu-item index="/system/roleList">
                <span slot="title">角色管理</span>
              </el-menu-item>
              <el-menu-item index="/system/rightList">
                <span slot="title">权限管理</span>
              </el-menu-item>
            </el-submenu>
            <el-submenu index="log">
              <template slot="title">
                <i class="el-icon-view"></i>
                <span>日志管理</span>
              </template>
              <el-menu-item index="/log/login">
                <span slot="title">登陆日志</span>
              </el-menu-item>
              <el-menu-item index="/log/system">
                <span slot="title">系统日志</span>
              </el-menu-item>
              <el-menu-item index="/log/newest">
                <span slot="title">日志监控</span>
              </el-menu-item>
            </el-submenu>
        </el-menu>
      </el-aside>

      <!-- 右边主界面 -->
      <el-main>
        <router-view/>
      </el-main>


    </el-container>

  </div>
</template>


<script>
  export default {
    data () {
      return {
        //布局容器css样式配置
        containerStyle: {
          height: '100%',
          width: '100%'
        }
      }
    },
    //初始化加载
    mounted: function () {

    },
    //具体js方法
    methods: {
      handleOpen (key, keyPath) {
        console.log(key, keyPath)
      },
      handleClose (key, keyPath) {
        console.log(key, keyPath)
      }
    }
  }
</script>


<style scoped>


</style>
